package com.yihaodian.common.util;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.log4j.Logger;

public class NetUtil {
	private static Logger logger = Logger.getLogger(NetUtil.class);

	public static String localAddress() {
		InetAddress address;
		try {
			address = InetAddress.getLocalHost();
			return address.getHostAddress();
		} catch (UnknownHostException e) {
			logger.error(e, e);
		}

		return "127.0.0.1";
	}

}
